@typeparam TItem
@inherits _BaseDataGridRow<TItem>
<TableRow Clicked="@OnSelectedCommand" Background="@((object)ParentDataGrid.SelectedRow == (object)Item ? Background.Primary : Background.None)">
    @foreach ( var column in Columns )
    {
        @if ( column.ColumnType == DataGridColumnType.Command )
        {
            @if ( ParentDataGrid.AllowEdit == true )
            {
                <_DataGridRowCommand EditState="DataGridEditState.None" Edit="@OnEditCommand" Delete="@OnDeleteCommand" Save="@OnSaveCommand" Cancel="@OnCancelCommand" />
            }
        }
        else
        {
            <TableRowCell>
                @if ( column.DisplayTemplate != null )
                {
                    @column.DisplayTemplate( Item )
                }
                else
                {
                    @column.GetValue( Item )
                }
            </TableRowCell>
        }
    }
</TableRow>